Skip to content

feat:Add Auth0-Custom-Domain header support for Multiple Custom Domains (MCD)#799

Merged
kishore7snehil merged 4 commits intomasterfrom
feat/mcd-support
Apr 9, 2026
Merged

feat:Add Auth0-Custom-Domain header support for Multiple Custom Domains (MCD)#799
kishore7snehil merged 4 commits intomasterfrom
feat/mcd-support

Conversation

@kishore7snehil
Copy link
Copy Markdown
Contributor

Added support for the Auth0-Custom-Domain header to enable Multiple Custom Domains (MCD).

Changes

  • Added custom_domain parameter to ManagementClient and AsyncManagementClient for setting the Auth0-Custom-Domain header globally
  • Added CustomDomainHeader helper for per-request header override via request_options
  • Implemented whitelist enforcement via httpx event hooks , header is only sent on 8 whitelisted endpoints, stripped on all others
Path Description
/api/v2/jobs/verification-email Verification email jobs
/api/v2/tickets/email-verification Email verification tickets
/api/v2/tickets/password-change Password change tickets
/api/v2/organizations/{id}/invitations Organization invitations
/api/v2/users Users (list/create)
/api/v2/users/{id} Users (get/update/delete)
/api/v2/guardian/enrollments/ticket Guardian enrollment tickets
/api/v2/self-service-profiles/{id}/sso-ticket SSO tickets

Enforcement is implemented via httpx request event hooks that strip the header on non-whitelisted paths before the request is sent.

  • Per-request CustomDomainHeader takes precedence over the global custom_domain when both are provided
  • Added 22 unit tests covering initialization, header merging, whitelist enforcement, and async support
  • Updated README.md with Custom Domains documentation

Usage

from auth0.management import ManagementClient, CustomDomainHeader

# Global — header sent on all whitelisted endpoints
client = ManagementClient(
    domain="your-tenant.auth0.com",
    token="YOUR_TOKEN",
    custom_domain="login.mycompany.com",
)

# Per-request override
client.users.create(
    connection="Username-Password-Authentication",
    email="user@example.com",
    password="SecurePass123!",
    request_options=CustomDomainHeader("other.mycompany.com"),
)

References

Checklist

  • All new/changed/fixed functionality is covered by tests
  • I have added documentation for all new/changed functionality
  • No Fern-generated files modified (all changes in .fernignore-listed files)

@kishore7snehil kishore7snehil requested a review from a team as a code owner March 23, 2026 08:16
duedares-rvj
duedares-rvj previously approved these changes Mar 23, 2026
@duedares-rvj
Copy link
Copy Markdown
Member

LGTM

# Conflicts:
#	src/auth0/management/management_client.py
@kishore7snehil kishore7snehil merged commit a10c4c6 into master Apr 9, 2026
9 checks passed
@kishore7snehil kishore7snehil deleted the feat/mcd-support branch April 9, 2026 10:39
@kishore7snehil kishore7snehil mentioned this pull request Apr 9, 2026
kishore7snehil added a commit that referenced this pull request Apr 9, 2026
**Added**
- feat: Add CIMD support, organization connections, group deletion,
refresh token listing; remove AOL/Flickr/Yammer providers
[\#816](#816)
([fern-api[bot]](https://github.com/apps/fern-api))
- feat:Add `Auth0-Custom-Domain` header support for Multiple Custom
Domains (MCD) [\#799](#799)
([kishore7snehil](https://github.com/kishore7snehil))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCD EA support

3 participants